import { get } from '../ajax'
import { getAjaxBaseUrl } from '../handler'

import type { STORAGE_MODES } from '@/enum/modules/indicator'

const baseUrl = getAjaxBaseUrl('/home', '/energy')

/** 首页分析 */
export function selectHomeAnalysis(timeType: STORAGE_MODES) {
  return get<any>(`${baseUrl}/analyse/${timeType}`)
}

/** 首页图表 */
export function selectHomeChart(timeType: STORAGE_MODES, value: string) {
  return get<any>(`${baseUrl}/info/${timeType}/${value}`)
}
